#ifndef _HT1632C_H_
#define _HT1632C_H_

#define HT1632C_Read 0x06
#define HT1632C_Write 0x05
#define HT1632C_Command 0x04
#define HT1632C_SYS_DIS 0x00
#define HT1632C_SYS_EN 0x01
#define HT1632C_LED_OFF 0x02
#define HT1632C_LED_ON 0x03
#define HT1632C_Blink_OFF 0x08
#define HT1632C_Blink_ON 0x09
#define HT1632C_Slave_Mode 0x10
#define HT1632C_RC_Master_Mode 0x18
#define HT1632C_EXT_CLK_Master_Mode 0x1C
#define HT1632C_COM_Option 0x24   //0b0010 abxx          // ab=00：N-MOS 漏极开路输出和 8 COM 选件 
                                                        //ab=01：N-MOS 漏极开路输出和 16 COM 选件 
                                                        //ab=10：P-MOS 漏极开路输出和 8 COM 选件 
                                                        //ab=11：P-MOS 漏极开路输出和 16 COM 选件
#define HT1632C_PWM_Duty 0xA8        /* 101X-0000-X C PWM 1/16 duty 
                                        101X-0001-X C PWM 2/16 duty
                                        101X-0010-X C PWM 3/16 duty
                                        101X-0011-X C PWM 4/16 duty
                                        101X-0100-X C PWM 5/16 duty
                                        101X-0101-X C PWM 6/16 duty
                                        101X-0110-X C PWM 7/16 duty
                                        101X-0111-X C PWM 8/16 duty
                                        101X-1000-X C PWM 9/16 duty
                                        101X-1001-X C PWM 10/16 duty
                                        101X-1010-X C PWM 11/16 duty
                                        101X-1011-X C PWM 12/16 duty
                                        101X-1100-X C PWM 13/16 duty
                                        101X-1101-X C PWM 14/16 duty
                                        101X-1110-X C PWM 15/16 duty
                                        101X-1111-X C PWM 16/16 duty*/


unsigned char HT1632C_ReadSingleData(unsigned char Address);
void HT1632C_ReadData(unsigned char Address);
extern unsigned char HT1632C_ReadPageData[32];
void HT1632C_WriteSingleData(unsigned char Address, unsigned char Data);
void HT1632C_WriteData(unsigned char Address, unsigned char *Data);
void HT1632C_WriteCommand(unsigned char Command);
void HT1632C_Init();
#endif